Skip to content

fix(tools): qualify title runs with native build provenance - #774

Draft
Thimo188 wants to merge 18 commits into
mainfrom
upstream-pr/22260
Draft

Thimo188 wants to merge 18 commits into
mainfrom
upstream-pr/22260

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#22260, originally opened by IvanFogel.

Source commit: 200ee3f56ed16a0045b197c13b19b9b7710da31d. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


What

Preserve compiled native commit/dirty evidence separately from the source checkout label in title-run summaries and comparisons. A source-A checkout can launch an older native-B runtime; retain both identities and qualify the mismatch instead of presenting the source label as the executed build. Keep legacy metrics readable with unknown provenance. Bisect recomputes qualification from raw evidence and rejects missing, conflicting, modified or mismatched runtime identity, including forged saved status and malformed protocol rows.

Matching means consistent self-reported compiled metadata; it does not attest every loaded library's bytes. The bisect fixture runs with the shared test entrypoint merged in boykopovar#22175.

Tested

Review update for 200ee3f56ed1. I checked the reported A, B, A sequence on da569b310279. The original reader already retained both distinct commit/dirty pairs and rejected both a conflicting commit and a numeric dirty flag. This revision explicitly keeps the first entry for each distinct pair in trace order. The representations of JSON false and 0 remain distinct. Repeated clean intervals still contribute all their frames.

Three Linux CLI regressions exercise the produced summary and the performance-bisect admission gate. A different middle commit yields conflicting. An intervening numeric zero remains an integer and yields unknown. Two matching clean intervals retain one identity, 120 presents and a qualifying 60 FPS sample. In isolated negative controls, the corresponding tests failed for a last-row-only collector, a Python value key that collapses false and 0, and a collector that stores every duplicate.

Linux qualification on this head ran the six registered title-run and performance-bisect suites as part of all 815 registered Python-tool CTests. All 815 passed. Some individual cases are platform-specific and skipped on Linux. The three new regressions also passed on trial merges with main 2b6c1b044528 and with boykopovar#22263, boykopovar#22267, boykopovar#22282 and boykopovar#22357. These tests use an owned executable fixture and a temporary Git checkout. Native Windows, macOS and commercial-title execution were not run for this update.

Review update for da569b310279. On Linux, the title-run CLI fixture reproduced the reviewer's mixed-log case on 805830872c25: the bisect reader rejected a clean 60 FPS sample as unknown after an ordinary JSON scalar or array was logged. The updated parser ignores unlabelled scalars and ordinary log arrays. It still counts a standalone aps5-bench/1 tag, an array beginning with that tag, or an array directly containing an object that declares that format. The fixture verifies that all three count as errors, make the bisect sample ineligible and leave the supplied commit out of native evidence. The separate damaged-record checks still exercise protocol and application logs.

Linux validation on this revision passed all six registered title-run and performance-bisect CTests and all 815 registered Python-tool CTests. Some individual test cases are platform-dependent and skipped on Linux. The two new CLI regression cases also passed on the trial merges with boykopovar#22263, boykopovar#22267, boykopovar#22282 and boykopovar#22357. The public CLI fixtures used temporary Git repositories and an owned test process. Native Windows, macOS, and commercial-title execution were not run for this change.

November 23 maintenance: exact head 8058308 retains submitted ff7f64c, fresh main 3492c18, and complete refreshed prerequisite histories (none). All 815 registered source-tools Python CTests pass on Linux in 146.55s at two workers, with zero CTest-level failures/skips; maximum 21.072s. This is the actual source-tools inventory selected by exact source Python-script paths. Python-driven relinker/core wrappers requiring compiled artifacts are outside this selection. Existing individual platform-specific Python skips remain. Current-main conventions, the complete PR body and the committed diff pass their checks.

The semantic merge retains main's BOM handling, duplicate/nonfinite JSON rejection, catalog/comparison validation, bounded metric types and finite arithmetic, string-only reported hardware fields, and stricter bisect identity text, including CPU. Native commit/dirty evidence is captured before rejecting malformed metrics: a filtered interval cannot erase a conflicting runtime identity. Nonobjects and recognizably malformed native rows retain the existing qualification/bisect rejection. Prefix decoding keeps the indexed cursor and handles recursive-decoder rejection without recovering an identity from broken JSON.

Three owned real-CLI integration controls run in a separate registered CTest (30-second timeout), reusing the existing real-process fixture without changing their assertion/control ASTs. They pass: a rejected-metric row still contributes conflicting native evidence while valid FPS stays readable; a duplicate native commit field makes qualification unknown and bisect reject; and a deeply malformed native row keeps valid metrics readable while remaining unqualified. The duplicate-only regression reproduced matched instead of unknown on the old submitted parent, then passed with main's strict loader integrated. These fixture processes exercise public orchestration and protocol handling; they do not establish real native/GPU/title execution.

All new reviews were compared with the exact November 22 evening final snapshot. They report no verified blocker; approvals and source-only reviews belong to the previously submitted heads and are not fresh approvals of this new revision. Draft, parent dependencies and inherited external order/review gates remain. No author agreement or all-peer clearance is invented. Native Windows/macOS, actual GPU/title runs and performance measurements were not rerun here. Earlier results below remain pinned to their original revisions.

On Linux at ff7f64c54b1a against main 8c254da48beb, all 807 registered CTests that run Python scripts under tools/ passed. The suite includes the title-run and performance-bisect tests. Some individual cases require another operating system.

I reproduced both provenance errors through the title-run command and the performance bisect. A damaged summary record could let an invalid run qualify, while an unrelated truncated JSON log could reject a valid run. The new tests cover both outcomes, including bracketed log prefixes and older summaries without a format field. The parser uses the available top-level fields to recognize a damaged record. Fragments that contain no identifiable protocol fields cannot establish its origin. Review on #22263 · Review on #22267

On November 22, I integrated main 70cca973b49f into a173fd1b770c. All 143 selected Linux CTests passed, including every changed Python test module. The summary reader now retains main’s LF-only JSONL record boundaries and this branch’s native identity and error reporting. A combined fixture preserved a GPU name containing U+0085, U+2028 and U+2029 and counted both an invalid JSON row and a non-object row. The old submitted head split the GPU name.

On November 21, all 142 selected Linux CTests passed on 606307b26b50 with main 6f18d49a833e. The selection includes the registered title-run tests and each test module changed by this PR. Some individual Python cases require another platform. Conventions and the committed diff checks passed. The test run includes the shared bisect fixture merged in boykopovar#22175.

On November 20, boykopovar#22175 at 506613cc9c and this submitted head at cc28a49e01 both merged without conflicts onto main 3a1b27b9d2 (local composition 03e6b5ab19). The bisect suite retains both sets of duplicate-key and provenance checks and a single test runner. All 142 selected Linux CTests passed, including the eight test modules changed by boykopovar#22175 and the title-run, identity and bisect tests affected here.

I also ran the unmodified performance-bisect and title-run CLIs against a disposable three-commit Git repository. Each commit built a small native Linux fixture with its commit ID compiled in. All nine 20-second samples qualified, and the bisector selected the first commit emitting 48 FPS after a 60 FPS baseline. A stale compiled ID stopped the bisect on the first sample, and a duplicate recipe key failed before sampling. The fixture emitted the frame and timing records. The FPS values are controlled test inputs. The run used a stand-in relinker and exercised no commercial title or GPU. The submitted head also passed the hosted Windows relinker and macOS relinker jobs. The local composition was exercised on CachyOS Linux.

Refresh at cc28a49e01 against main 87ee89b036. The new end-to-end bisect fixture now emits the clean native commit required by the provenance checks. The duplicate recipe-field tests from main are retained. On Linux, 324 of 331 tests passed across 5 relevant Python modules, with 7 platform skips and zero failures. Conventions and whitespace passed. The hosted Windows and macOS results are linked above.

Current tool-branch refresh, 2026-11-17: exact head 20028d476ab02549faf74d4715967aff9fb967ec, integrating tested main cb28e72762dad4d5b5448f30c5a7ebad3d0af56c and the complete refreshed prerequisite history. Merged boykopovar#22245 runtime staging and boykopovar#22241 generic bisect tests are preserved. The bisect EOF union retains every previous and upstream assertion with one final unittest.main; short-observation also retains both the auxiliary-runtime import and all unranked incomplete handling.

The merged staging preflight requires allocator sidecars in controlled fake builds. The fixture now supplies nonempty Linux/macOS payload names so the original CLI scenarios execute; those bytes are not loaded native shared libraries. Native provenance, malformed-record handling, context/machine qualification, short-observation classification and bisect admission gates are unchanged. Independent AST/object proof and maintenance review verified those boundaries and all old assertions; nine bounded integration/regression checks passed independently.

All 697/697 registered Python-tools CTests pass, with zero CTest-level failures/skips and maximum 22.1648s per selected test. Existing embedded unittest platform skips remain explicit in the qualification reports. Current conventions and whitespace pass. Pinned four-candidate qualification results. No native Windows/macOS, real title, GPU or native-library load is established by these Linux fixtures. Later main has separate clean merge-tree/source-scope evidence, not a relabeled full-suite run.

Canonical overlap still exits2 with exact shared-file/manual dispositions retained; no all-peer clearance or outside-author agreement is claimed. That earlier run left the external fixture, platform and landing-order questions open. The November 20 results above cover the composition on Linux and hosted checks on the submitted head. boykopovar#22241 and boykopovar#22245 are now merged rather than pending prerequisites.

Earlier pinned validation and review dispositions

Linux/CachyOS at exact corrected head 9d3a0f50156c8e4445d2d19f6ac278ff18b0bde3, based on main 75bfb265186364d074ab1de36adf2055af16b685.

  • Real public CLI fixtures with owned subprocesses and temporary Git repositories reproduced source-A/native-B mislabeling before the fix. Controls cover a clean match, modified/conflicting identities, report-only/summary-only/legacy data, malformed reports, malformed/truncated/non-object summary records and unrelated logs.
  • Independent review found an Important integrity hole: clean matching evidence could hide a dropped malformed row. New regressions reproduced that acceptance, then passed after bounded protocol-error counts were retained and made provenance unknown. No identity is guessed from broken JSON; valid FPS remains readable.
  • Final direct title-run suite:112 cases,107 passed and five existing platform skips. Direct bisect suite:64 cases,63 passed and one existing platform skip. All696 registered Python-tools CTests pass, with zero CTest-level failures/skips (57.92s total; maximum21.94s). Conventions and whitespace pass.
  • Source-A/native-B and malformed-row artifacts were produced through the real runner/report/comparison/bisect-sample data flow. Native Windows/macOS, commercial-title/GPU execution and a complete real bisect-loop pass were not measured; fixture behavior is not native-title evidence.
  • Later main 9eae4b460d90a45aa7806d6730354f385eebbdbe changes none of the affected tool/test inputs; its mechanical merge is checked before publication, without claiming a separate merged-tree test run.

Canonical exact-head overlap fetched1,648 open heads and exits2. At the time of that scan the concrete collisions were the standard bisect-test EOF entrypoint shared with independent generic-test peers boykopovar#22175/boykopovar#22241; preserve both test groups and one runner. The entrypoint support is shared with/credited to boykopovar#19124, whose separate results-directory production fix is not copied. boykopovar#19124 advanced to a6048430293c70eb72e70bdc9565c2a3798fcc67; its exact new patch was rechecked and adds no native provenance implementation, but its synthetic integration fixture must emit native identity when composed with this change. boykopovar#20315 has separately scoped trace documentation. Four unrelated title-test append collisions were removed.

At the time of this earlier check, the shared bisect fixture and entrypoint still needed integration testing. The November 20 run establishes their behavior together. The proposed order with boykopovar#22175 remains open.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 776 tools/tests/test_title_run_summary_provenance.py
tools/title_run_provenance.py
PR 777 tools/tests/test_title_run_summary_provenance.py
tools/title_run_provenance.py
PR 781 tools/tests/test_title_run_summary_provenance.py
tools/title_run_provenance.py
PR 787 tools/tests/test_title_run_summary_provenance.py
tools/title_run_provenance.py
PR 1014 tools/title_run_provenance.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant